package top.lcm889.juc.count_down_latch;

import java.util.concurrent.CountDownLatch;

/**
 * @author Coder-lcm
 * @date 2021/4/30
 */
public class TestCountDownLatch {
    public static void main(String[] args) throws InterruptedException {
        final int customerThreadCount = 3;
        CountDownLatch latch = new CountDownLatch(customerThreadCount);
        new Thread(new CustomerThread(latch, "c1")).start();
        new Thread(new CustomerThread(latch, "c2")).start();
        new Thread(new CustomerThread(latch, "c3")).start();
        Thread.sleep(100);

        new Thread(new WriterThread(latch, "w")).start();
    }
}
